package com.spring.theory.bean.lifeCycle;

import static com.spring.theory.constant.GeneralConstant.LOG_INFO;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * bean生命周期执行顺序
 *
 * @author H
 * @version 1.0
 * @date 2023-12-27 14:10
 */
@SpringBootApplication
@Slf4j
public class TestLifeCycleApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(TestLifeCycleApplication.class, args);
        context.close();
    }

    //@Bean(initMethod = "init",destroyMethod = "destroy1")
    public Bean1 bean1() {
        log.info(LOG_INFO);
        return new Bean1();
    }

}
